#!/bin/bash
pkgname=sxAdmin
path=/home/ubuntu/video_chat
tarname=$pkgname.tar.gz
ip=13.214.130.207
user=ubuntu


# 编译
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o $pkgname
# 压缩
#tar zvcf $pkgname.tar.gz $pkgname 
#./docs
echo "scp to remote..."

#scp  -P 12026 -i ./singapore.pem  $tarname $user@$ip:$path
#ssh  -p 12026 -i ./singapore.pem $user@$ip "cd $path && sudo tar zxf $tarname && sudo rm -f $tarname"



echo "remove local tar"
#rm -f $pkgname
#rm -f $tarname